/-app ...
TopLayout.ts
main.css
start.ts
/-docs
/-files
/-imports
/-storage
/-storage/api
/-storage/dom
/-storage/indexedDB
FileData.ts
MetadataData.ts
StorageAccess.ts
StorageDetect.ts
functions.ts
/-storage/localStorage
/-storage/webSQL
/-typings
errors.js
functions.ts
index.html
try.js
x
            alert('save:write/read:\n' + JSON.stringify(byFullPath, null, 2) + '\n' + JSON.stringify(byFullPath1, null, 2));
88
        while (el && !el._node) {
89
          el = el.parentElement;
90
        }
91
        
92
        if (el)
93
          this._onclick(el._node);
94
      }, true);
95
    }
96
  
97
    private _onclick(node) {
98
      var fullPath = node.fullPath;
99
      
100
      if (this._activeDocPath === fullPath)
101
        return;
102
      
103
      if (node.isDir())
104
        return;
105
      
106
      var oldDoc = this._docCache[this._activeDocPath];
107
      if (oldDoc)
108
        oldDoc.close();
109
      while (this.mainContent.children.length) {
110
        this.mainContent.removeChild(this.mainContent.children[this.mainContent.children.length - 1]);
111
      }
112
      
113
      var doc =
114
        this._docCache[fullPath] ||
115
        (this._docCache[fullPath] = docs.types.load({
116
          fullPath: fullPath,
117
          read: (propertyNames: string[]) => this._read(fullPath, propertyNames),
118
          write: (byProp) => this._write(fullPath, byProp)
119
        }));
120
      
121
      var elem = doc.open();
122
​
123
      elem.style.width = '100%';
124
      elem.style.height = '100%';
125
      
126
      this.mainContent.appendChild(elem);
127
      
128
      return false;
129
    }
130
  
131
    private _read(fullPath: string, propertyNames: string[]): { [propertyName: string]: string; } {
132
      var response = this._fileTree.access.read([fullPath]);
133
      var fileProps = response[fullPath];
134
      return fileProps;
135
    }
136
​
137
    private _write(fullPath: string, byProp: { [propertyName: string]: string; }) {
138
​
139
      var byFullPath: storage.PropertiesByFullPath = {};
140
      byFullPath[fullPath] = byProp;
141
​
142
      var now = dateNow();
143
      this._fileTree.access.update(byFullPath, now);
144
      if (this._access)
145
        this._access.update(byFullPath, now, () => {
146
          // do nothing
147
        });
148
​
149
    }
150
    
151
  }
152
  
153
}
145:23